package com._520it.day2._06_template.crud;


import java.util.List;

import org.junit.Test;

public class StudentDAOTest {
	//依赖
	private StudentDAOImpl dao=new StudentDAOImpl();

	@Test
	public void testAdd() {
		Student stu = new Student();
		stu.setName("司空摘星");
		stu.setAge(25);
		dao.add(stu);
	}

	@Test
	public void testDelete() {
		dao.delete(7L);
	}

	@Test
	public void testUpdate() {
		Student stu = new Student();
		stu.setName("陆小凤");
		stu.setAge(28);
		stu.setId(8L);
		dao.update(stu);
	}

	@Test
	public void testGet() {
		Student stu = dao.get(3L);
		System.out.println(stu);
	}

	@Test
	public void testList() {
		List<Student> list = dao.list();
		for (Student s : list) {
			System.out.println(s);
		}
	}

}
